/********************************************************************************
 *      Copyright:  (C) 2023 iot<iot@email.com>
 *                  All rights reserved.
 *
 *       Filename:  socket.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(04/20/23)
 *         Author:  iot <iot@email.com>
 *      ChangeLog:  1, Release initial version on "04/20/23 20:25:31"
 *                 
 ********************************************************************************/
#ifndef _SOCKET_H_
#define _SOCKET_H_

typedef struct socket_s //_s struct
{
 	int		socketfd;
	char	hostname[128];
	int		port;
	int		status;  //0:disconnected 1:connected
}socket_t;  //_t type

int socket_init(socket_t *socket,char *hostname,int port);
int socket_connect(socket_t *socket);
int socket_state(socket_t *socket);
void socket_close(socket_t *socket);

#endif
